﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>Check European Union VAT</title>
    <style type="text/css">
        body {
            background-color: rgb(233, 237, 241);
            font-family: 'Segoe UI',Arial;
        }

        table {
            margin: 5px;
            width: 100%;
        }

        .label {
            width: 343px;
        }
        .values {
            width: 100%;
        }
    </style>

    <script src="crmlicensing.lib.min.js" type="text/javascript"></script>

    <script type="text/javascript">

        function doVerify() {
            var sMsg = OrgName.value;
            var hSig = License.value;

            var rsa = new RSAKey();
            rsa.loadPublicKeyFromXml(PublicKey.value);

            hSig = b64tohex(hSig);

            var isValid = rsa.verifyString(sMsg, hSig);

            // display verification result
            if (isValid) {
                Results.value = "Valid License";
            } else {
                Results.value = "Not Valid License";
            }
        }

    </script>

</head>
<body>
    <h2>License Checker</h2>
    <table>
        <tr>
            <td class="label">Public Key</td>
            <td>
                <input type="text" name="PublicKey" class="values" /></td>
        </tr>
        <tr>
            <td class="label">License</td>
            <td>
                <input type="text" name="License" class="values" /></td>
        </tr>
        <tr>
            <td class="label">OrgName</td>
            <td>
                <input type="text" name="OrgName"class="values" /></td>
        </tr>
        <tr>
            <td>
                <input type="button" value="Check" onclick="doVerify();"></td>
            <td>
                <input type="text" name="Results" class="values"/></td>
        </tr>

    </table>
</body>
</html>
